function addTenZero(num) {
  return num < 10 ? ('0' + num) : ('' + num)
}
const TimeHelper = {
  getFormatDate(nS) {
    if (!nS) return "-"
    if (parseInt(nS) == -1) return "永久"
    let date = new Date(parseInt(nS) * 1000);
    let formatDate = (now) => {
      var year = now.getFullYear();
      var month = now.getMonth() + 1;
      var date = now.getDate();
      var hour = now.getHours();
      var minute = now.getMinutes();
      var second = now.getSeconds();
      return year + "-" + addTenZero(month) + "-" + addTenZero(date) + " " + addTenZero(hour) + ":" + addTenZero(minute) + ":" + addTenZero(second);
    }
    return formatDate(date)
  }
}

export default TimeHelper